package com.learn.lsp.good;

import com.learn.lsp.bad.Rectangle;

public class Test {


    public static void calculation(Quadrilateral quadrilateral) {
        while (quadrilateral.getWidth() >= quadrilateral.getHeight()) {
            System.out.println("宽为: " + quadrilateral.getWidth() + " 高为: " + quadrilateral.getHeight());
            // 可以看到只能用长方形，不可以用正方形， 表达了 子类不可以修改父类原有功能
            //            quadrilateral.setHeight(quadrilateral.getHeight() + 1);
        }
        System.out.println("结束宽为: " + quadrilateral.getWidth() + " 结束高为: " + quadrilateral.getHeight());
    }
}
